package com.orafl.use.comorafluse.IOC.Lookup;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import java.util.Map;

public class LookUpByTypeDemo {

    public static void main(String[] args) {
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(LookUpBean.class,ObjectFactoryTest.class);

        //类型查找
        Map<String, LookUpBean> map = context.getDefaultListableBeanFactory().getBeansOfType(LookUpBean.class);

        // 根据注解获取
        // Map<String, LookUpBean> map = context.getDefaultListableBeanFactory().getBeansWithAnnotation();

        System.out.println(map);
    }
}
